package vn.njai.thousand_english_word.Utils;

import android.content.Context;
import android.util.DisplayMetrics;

/**
 * Created by VUONG on 12/21/2014.
 */
public class Utils {
    private String TAG = "Utils";
    public static int mScreenWeight;
    public static int mScreenHeight;
    public static final String mAppRatingLink = "vn.njai.thousand_english_word";

    public static int convertDpToPixel(float dp, Context context) {
        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        float px = dp * (metrics.densityDpi / 160f);
        return (int) px;
    }

    public static int getStatusBarHeight(Context context) {
        int result = 0;
        int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result = context.getResources().getDimensionPixelSize(resourceId);
        }
        return result;
    }
}
